<?php require VIEW_PATH."/header.php";?>
<body>
	<form method="post">
    <input type="hidden" name="cat_id" value="{{$data['cat_id']}}">
        <table class="hd-table hd-table-form hd-form">
            <thead>
                <tr>
                    <td colspan="2">修改栏目</td>
                </tr>
            </thead>
            <tbody>
                <tr>
                <th>父级</th>
                <td>
                    <select name="pid">
                        <option value="0">===顶级栏目===</option>
                        {{foreach from="$cat" value="$field"}}
                            <option value="{{$field['cat_id']}}"
                            {{if value="$data['pid']==$field['cat_id']"}}
                            selected
                            {{endif}}
                            {{if value="$data['cat_id']==$field['cat_id']"}}
                            disabled
                            {{endif}}
                            {{if value="Data::isChild($cat,$field['cat_id'],$data['cat_id'],'cat_id')"}}
                            disabled
                            {{endif}}    
                            >
                            {{$field['_name']}}
                            </option>
                        {{endforeach}}
                    </select>
                </td>
            </tr>
            <tr>
                <th>栏目名称</th>
                <td>
                    <input type="text" name="cat_name" value="{{$data['cat_name']}}" class="hd-w300">
                </td>
            </tr>
            <tr>
                <th>所属类型</th>
                <td>
                    <select name="type_id">
                        <option value="0">===请选择类型===</option>
                        {{foreach from="$ShopType" value="$field"}}
                            <option value="{{$field['id']}}"
                            {{if value="$data['type_id']==$field['id']"}}
                            selected
                            {{endif}}
                            {{if value="$data['type_id']==$field['id']"}}
                            disabled
                            {{endif}}   
                            >
                            {{$field['type_name']}}
                            </option>
                        {{endforeach}}
                    </select>
                </td>
            </tr>
            <tr>
                <th>栏目关键词</th>
                <td>
                    <input type="text" name="keyword" value="{{$data['keyword']}}" class="hd-w300">
                </td>
            </tr>
            <tr>
                <th>栏目描述</th>
                <td>
                    <textarea name="dest" class="hd-w300 hd-h100">{{$data['dest']}}</textarea>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <button class="hd-btn hd-btn-primary">提交</button>
                </td>
            </tr>
        </tbody>
    </table>
</form>
</body>
</html>